//
//  QDNewsSectionHeaderView.m
//  QDMetroClient
//
//  Created by YueWen on 2019/2/15.
//  Copyright © 2019 YueWen. All rights reserved.
//

#import "QDNewsSectionHeaderView.h"

@implementation QDNewsSectionHeaderView

- (instancetype)initWithFrame:(CGRect)frame {
    if (self = [super initWithFrame:frame]) {
        [self buildViews];
    }
    return self;
}


- (instancetype)initWithReuseIdentifier:(NSString *)reuseIdentifier {
    if (self = [super initWithReuseIdentifier:reuseIdentifier]) {
        [self buildViews];
    }
    return self;
}


- (void)buildViews {
    
    //如果已经初始化完毕了，就不需要
    if (_titleLabel) { return; }
    
    self.topMargin = 20;
    self.contentView.backgroundColor = UIColor.whiteColor;
    self.titleLabel = ({
        
        UILabel *label = [UILabel new];
        label.backgroundColor = [UIColor whiteColor];
        label.text = @"地铁资讯";
        label.font = RITLSemiboldFont(22);
        label.textColor = QDSColorDefaultBlack;
        
        label;
    });
    
    [self.contentView addSubview:self.titleLabel];
    
    [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.offset(20);
        make.top.offset(self.topMargin);
        make.height.mas_equalTo(30);
    }];

}

@end
